<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.css}">
    <link rel="stylesheet" th:href="@{/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/css/theme.css}">
    <style>
        #footer {
            padding: 15px 0;
            background: #fff;
            border-top: 1px solid #ddd;
            text-align: center;
        }

        #topcontrol {
            color: #fff;
            z-index: 99;
            width: 30px;
            height: 30px;
            font-size: 20px;
            background: #222;
            position: relative;
            right: 14px !important;
            bottom: 11px !important;
            border-radius: 3px !important;
        }

        #topcontrol:after {
            /*top: -2px;*/
            left: 8.5px;
            content: "\f106";
            position: absolute;
            text-align: center;
            font-family: FontAwesome;
        }

        #topcontrol:hover {
            color: #fff;
            background: #18ba9b;
            -webkit-transition: all 0.3s ease-in-out;
            -moz-transition: all 0.3s ease-in-out;
            -o-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
        }

        .nav-tabs > li.active > a, .nav-tabs > li.active > a:focus, .nav-tabs > li.active > a:hover {
            border-bottom-color: #ddd;
        }

        .nav-tabs > li > a {
            border-radius: 0;
        }
    </style>
</head>
<body>
<div id="bigdiv" class="navbar-wrapper">
    <div class="container">
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="/" style="font-size:32px;">互联网医药平台</a>
                </div>
                <div th:if="${session.user == null}" id="navbar" class="navbar-collapse collapse" style="float:right;">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="/default/log">登录</a></li>
                        <li><a href="/default/reg">注册</a></li>
                    </ul>
                </div>
                <div th:if="${session.user != null}" id="navbar1" class="navbar-collapse collapse" style="float:right;">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i
                                class="glyphicon glyphicon-user"></i><span
                                th:text="${session.user.getUserName()}"></span><span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#"><i class="glyphicon glyphicon-scale"></i> 我的信息</a></li>
                                <li class="divider"></li>
                                <li><a href="/user/outLogin"><i class="glyphicon glyphicon-off"></i> 退出系统</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>
</div>


<div class="container theme-showcase" role="main">


    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <nav class="navbar navbar-default" role="navigation">
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li>
                                <a rel="nofollow" href="/"><i class="glyphicon glyphicon-home"></i> 首页</a>
                            </li>
                            <li class="active">
                                <a rel="nofollow" href="#"><i class="glyphicon glyphicon-th-large"></i>
                                    药品库</a>
                            </li>
                            <li>
                                <a rel="nofollow" href="#"><i
                                    class="glyphicon glyphicon-chevron-up"></i>
                                    药品排行</a>
                            </li>
                            <li>
                                <a rel="nofollow" href="#"><i class="glyphicon glyphicon-search"></i>
                                    疾病找药</a>
                            </li>
                            <li>
                                <a rel="nofollow" href="#"><i class="glyphicon glyphicon-user"></i>
                                    用药心得</a>
                            </li>
                            <li>
                                <a rel="nofollow" href="#"><i class="glyphicon glyphicon-plane"></i>
                                    用药方案</a>
                            </li>
                            <li>
                                <a rel="nofollow" href="#"><i class="glyphicon glyphicon-random"></i>
                                    资讯频道</a>
                            </li>
                        </ul>
                    </div>
                </nav>
            </div>
        </div>
    </div>


    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="row clearfix">
                    <div class="col-md-4 column">
                        <img alt="140x140" width="350" height="500" th:src="@{/img/p2.jpg}"/>
                        <hr>
                        <p>
                            温馨提示：图片均为原品的真实拍摄，仅供参考；如遇新包装上市可能存 在更新滞后，请以实物为准！
                        </p>
                    </div>

                    <div class="col-md-5 column">
                        <div class="panel panel-default" style="border-radius: 0px;">
                            <div class="panel-body">
                                <p>药品名字:<span th:text="${drug.drugName}"></span></p>
                                <hr>
                                <p>参考价 ￥:<span th:text="${drug.drugPrice}"></span></p>
                                <hr>
                                <p>批准文号:<span th:text="${drug.drugNumber}"></span></p>
                                <hr>
                                <p>生产企业:<span th:text="${drug.drugPlace}"></span></p>
                                <hr>
                                <p>主治功能:<span th:text="${drug.drugFunction}"></span></p>
                                <hr>
                                <p>用法规格:<span th:text="${drug.drugSpec}"></span></p>
                                <hr>
                                <div class="col-md-6">
                                    <button id="pays" th:onclick="'javascript:pay(\''+${drug.drugId}+'\')'" th:attr="data-user=${session.user}"
                                            class="btn btn-danger btn-lg btn-block"
                                    >立即支付
                                    </button>

                                </div>
                                <div class="col-md-6">
                                    <button disabled="disabled" id="carts" type="button"
                                            class="btn  btn-warning btn-lg btn-block"

                                    >加入购物车
                                    </button>
                                </div>
                            </div>
                            <hr>
                            <div class="panel-body">
                                <p>
                                    说明：药品库商品均来自具备合法资质的药品零售连锁企业，点击购买将跳转 到具备《互联网药品交易服务资格证书》的合作网站购买
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 ">
                        <div><h2>为你推荐</h2>
                            <hr>
                        </div>
                        <div class="prjtip panel panel-default" style="border-radius: 0px;">
                            <div class="panel-body">
                                <img th:src="@{/img/p3.jpg}" width="100%" height="100%">
                            </div>
                        </div>

                        <div class="prjtip panel panel-default" style="border-radius: 0px;">
                            <div class="panel-body">
                                <img th:src="@{/img/p1.jpg}" width="100%" height="100%">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container" style="margin-top:20px;">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div id="footer">
                <div class="footerNav">
                    <a rel="nofollow" href="http://www.qf.com">关于我们</a> | <a rel="nofollow"
                                                                             href="http://www.qf.com">服务条款</a>
                    | <a
                    rel="nofollow" href="http://www.qf.com">免责声明</a> | <a rel="nofollow"
                                                                          href="http://www.qf.com">网站地图</a>
                    | <a rel="nofollow" href="http://www.qf.com">联系我们</a>
                </div>
                <div class="copyRight">
                    Copyright ?2010-2014qf.com 版权所有
                </div>
            </div>

        </div>
    </div>
</div>
</div>

<script th:src="@{/jquery/jquery-2.1.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/script/docs.min.js}"></script>
<script th:src="@{/script/back-to-top.js}"></script>
<script>
    function pay(drugId) {
        if ($("#pays").data("user") != undefined){
            //$.post('/order/addOrder/'+drugId)
            location.href ='/drug/show/'+drugId;
        }else {
            if (confirm("本功能仅为会员用户开放,是否去登陆")) {
                location.href = "/default/log";
            }
        }
    }

    /*var count=1;
    var price=0;
    var totalMoney=0;
    function totals(){
        count = $("input[name='count']").val();
        price = $("input[name='drugPrice']").val();
        totalMoney = count *price;
        $("input[name='totalMoney']").val(totalMoney);

    }
    $(function () {

        $("input").css("border", "hidden");
        console.log($("#bigdiv").data('user'));
        if ($("#bigdiv").data('user') != undefined) {
            $("#pays,#carts").click(function () {
                var drugId = $(this).data('id');
                console.log(drugId);
                if ($(this).attr('id') == 'pays') {
                    $(this).attr("data-target", "#myModal");

                    $('#zhifu').click(function () {

                        $.ajax({
                            url: "/",
                            type: "POST",
                            dataType: "json",
                            data:$("#zhifui").serialize(),
                            data:{

                            },
                            success:function (status,response) {
                                console.log(response == 'success')
                                if (response == 'success') {
                                    alert("注支付成功，返回登陆页"),
                                        window.location.href = ""
                                }
                            },
                            error:function () {
                                alert("支付失败");

                            }
                        })
                    })

                } else {
                    $(this).attr("data-target", "#myModa2");
                }

            });

        }else {
            $("#pays,#carts").click(function () {
                if (confirm("是否去登陆")) {
                    location.href = "/log";
                }
            });
        }

    })
*/
</script>
</body>
</html>